//发布投票参数类型
export interface publishVoteParamsType {
  /**
   * 封面
   */
  cover?: string;
  endTime?: string;
  /**
   * 类型
   */
  genre?: string;
  /**
   * 简介
   */
  intro?: string;
  list: playerType[];
  startTime?: string;
  state?: string;
  tittle?: string;
  images: imageType[];
  datetimerange: string[];
}

export type playerType = {
  cover?: string;
  intro?: string;
  state?: string;
  tittle: string;
  images: imageType[];
};

export type imageType = {
  url: string;
  name: string;
};

export enum PublishState {
  pending = "pending",
  approved = "approved",
  editing = "editing",
  rejected = "rejected",
}

//获取投票列表参数类型
export type voteListParamsType = {
  page: number;
  size: number;
  state: PublishState;
  genre?: string;
  startTime?: string;
  endTime?: string;
  tittle?: string;
};

//返回投票列表类型
export type voteListResponseType = {
  id: string;
  genre: string;
  startTime: string;
  endTime: string;
  tittle: string;
  intro: string;
  cover: string;
  state: string;
  pnum: number;
  vnum: number;
  view: number;
  uid: number;
  images: imageType[];
};

export type pageType<T> = {
  total: number;
  pages: number;
  size: number;
  current: number;
  records: T[];
};

export type addPlayerType = {
  id?: string;
  uid?: string;
  actId?: string;
  cover: string;
  intro: string;
  tittle: string;
  state: string;
  images: imageType[];
};

export type playerParamsType = {
  actId: string;
  tittle?: string;
  page: number;
  size: number;
  order?: number;
  state?: string;
};

export type playerResponseType = {
  id: string;
  actId: string;
  cover: string;
  intro: string;
  num: number;
  tittle: string;
  state: string;
  cause: string;
  images: imageType[];
};

//修改投票参数类型
export type editVoteParamsType = {
  cover: string;
  endTime: string;
  genre: string;
  /**
   * ID 编号
   */
  id: string;
  intro: string;
  startTime: string;
  state: string;
  tittle: string;
  images: imageType[];
  datetimerange: string[];
};

//获取我投票的记录
// 定义投票记录的接口类型
export interface VoteRecord {
  id: string;
  actId: string; // 活动的ID
  cover: string; // 选手封面图片
  tittle: string;
  intro: string; // 内容
  num: number; // 投票数
  state: string; // 活动的状态
  uid: string; // 用户ID
}

// 返回数据类型
export interface MyVoteResponse {
  code: string;
  message: string | null;
  data: VoteRecord[];
  success: boolean;
}

// 声明返回的活动列表项的类型
export interface myEntereType {
  id: string;
  actId: string;
  uid: string; // 用户ID
  cover: string; // 封面图片URL
  intro: string; // 活动简介
  num: number; // 活动的报名人数/参与人数
  tittle: string; // 活动标题
  state: string; // 活动状态（例如：进行中、已结束）
  cause: string; //拒绝理由
  images?: imageType[]; // 活动图片
}
